//
//  AnnouncementDetails.m
//  WestAir
//
//  Created by s on 16/10/4.
//  Copyright © 2016年 Henry. All rights reserved.
//

#import "AnnouncementDetails.h"
#import "AnnouncementDetailsCell.h"

@interface AnnouncementDetails ()<UITableViewDelegate,UITableViewDelegate>

@end

@implementation AnnouncementDetails

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)popBack:(id)sender {
    
    
    [self.navigationController  popViewControllerAnimated:YES];
}


#pragma  mark   tableView  delegate

#pragma mark Tableview Deleget

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return  _arrData.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    AnnouncementDetailsCell  *cell=[tableView dequeueReusableCellWithIdentifier:@"AnnouncementDetailsCell"];
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    NSDictionary *dicData=_arrData[indexPath.row];
    cell.lableTitle.text=[dicData[@"FTitle"] nullClass];
    cell.lableTime.text=[dicData[@"FDate"]  nullClass];
    cell.lableContent.text=[dicData[@"FContent"]  nullClass
                            ];
    
    VIEW_CORNER(cell.viewBG, 4.0);
    
    return cell;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
     NSDictionary  *dicData=_arrData[indexPath.row];
     NSString  *content=dicData[@"FContent"];
     
    CGSize  size= [CMCCIOTIGUnity  getSize:content andSize:CGSizeMake(SCREEN_WIDTH-40, MAXFLOAT) and:[UIFont systemFontOfSize:15]];
    
    
    return  size.height+90;
    
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    [tableView deselectRowAtIndexPath:indexPath animated:YES];

}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
